package com.nbsaas.boot.data.rest.resource;

import com.nbsaas.boot.data.api.apis.QuerySnippetApi;
import com.nbsaas.boot.data.data.entity.QuerySnippet;
import com.nbsaas.boot.data.api.domain.request.QuerySnippetRequest;
import com.nbsaas.boot.data.api.domain.response.QuerySnippetResponse;
import com.nbsaas.boot.data.api.domain.simple.QuerySnippetSimple;
import com.nbsaas.boot.data.rest.convert.QuerySnippetSimpleConvert;
import com.nbsaas.boot.data.rest.convert.QuerySnippetEntityConvert;
import com.nbsaas.boot.data.rest.convert.QuerySnippetResponseConvert;
import com.nbsaas.boot.data.data.repository.QuerySnippetRepository;

import java.io.Serializable;
import com.nbsaas.boot.jpa.data.core.BaseResource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation;

import java.util.function.Function;
/**
*   -业务接口实现
*/
@Transactional
@Service
public class QuerySnippetResource extends BaseResource<QuerySnippet,QuerySnippetResponse, QuerySnippetSimple, QuerySnippetRequest>  implements QuerySnippetApi {

    @Resource
    private QuerySnippetRepository querySnippetRepository;

    @Override
    public JpaRepositoryImplementation<QuerySnippet, Serializable> getJpaRepository() {
        return querySnippetRepository;
    }

    @Override
    public Function<QuerySnippet, QuerySnippetSimple> getConvertSimple() {
        return new QuerySnippetSimpleConvert();
    }

    @Override
    public Function<QuerySnippetRequest, QuerySnippet> getConvertForm() {
        return new QuerySnippetEntityConvert();
    }

    @Override
    public Function<QuerySnippet, QuerySnippetResponse> getConvertResponse() {
        return new QuerySnippetResponseConvert();
    }




}


